﻿USE [master]
GO
/****** Object:  Database [wms]    Script Date: 2024-03-13 14:11:51 ******/
CREATE DATABASE [wms]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'wms', FILENAME = N'd:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\wms.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
 LOG ON 
( NAME = N'wms_log', FILENAME = N'd:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\wms_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
 WITH CATALOG_COLLATION = DATABASE_DEFAULT, LEDGER = OFF
GO
ALTER DATABASE [wms] SET COMPATIBILITY_LEVEL = 160
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [wms].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [wms] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [wms] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [wms] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [wms] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [wms] SET ARITHABORT OFF 
GO
ALTER DATABASE [wms] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [wms] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [wms] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [wms] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [wms] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [wms] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [wms] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [wms] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [wms] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [wms] SET  DISABLE_BROKER 
GO
ALTER DATABASE [wms] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [wms] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [wms] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [wms] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [wms] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [wms] SET READ_COMMITTED_SNAPSHOT ON 
GO
ALTER DATABASE [wms] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [wms] SET RECOVERY FULL 
GO
ALTER DATABASE [wms] SET  MULTI_USER 
GO
ALTER DATABASE [wms] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [wms] SET DB_CHAINING OFF 
GO
ALTER DATABASE [wms] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [wms] SET TARGET_RECOVERY_TIME = 60 SECONDS 
GO
ALTER DATABASE [wms] SET DELAYED_DURABILITY = DISABLED 
GO
ALTER DATABASE [wms] SET ACCELERATED_DATABASE_RECOVERY = OFF  
GO
EXEC sys.sp_db_vardecimal_storage_format N'wms', N'ON'
GO
ALTER DATABASE [wms] SET QUERY_STORE = ON
GO
ALTER DATABASE [wms] SET QUERY_STORE (OPERATION_MODE = READ_WRITE, CLEANUP_POLICY = (STALE_QUERY_THRESHOLD_DAYS = 30), DATA_FLUSH_INTERVAL_SECONDS = 900, INTERVAL_LENGTH_MINUTES = 60, MAX_STORAGE_SIZE_MB = 1000, QUERY_CAPTURE_MODE = AUTO, SIZE_BASED_CLEANUP_MODE = AUTO, MAX_PLANS_PER_QUERY = 200, WAIT_STATS_CAPTURE_MODE = ON)
GO
USE [wms]
GO
/****** Object:  Table [dbo].[T_MOD]    Script Date: 2024-03-13 14:11:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_MOD](
	[PK] [varchar](20) NOT NULL,
	[CREATEDATE] [varchar](20) NULL,
	[CREATOR] [varchar](20) NULL,
	[MODIFYDATE] [varchar](20) NULL,
	[MODIFIER] [varchar](20) NULL,
	[DELETEUSER] [varchar](20) NULL,
	[DELETEDATE] [varchar](20) NULL,
	[DEL] [char](1) NULL,
	[FLAG] [int] NULL,
	[MODCODE] [varchar](50) NULL,
	[MODNAME] [varchar](50) NULL,
	[ACCESSMODE] [int] NULL,
 CONSTRAINT [PK_T_MOD] PRIMARY KEY CLUSTERED 
(
	[PK] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[T_ORDER]    Script Date: 2024-03-13 14:11:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_ORDER](
	[PK] [varchar](20) NOT NULL,
	[CREATEDATE] [varchar](20) NULL,
	[CREATOR] [varchar](20) NULL,
	[MODIFYDATE] [varchar](20) NULL,
	[MODIFIER] [varchar](20) NULL,
	[DELETEUSER] [varchar](20) NULL,
	[DELETEDATE] [varchar](20) NULL,
	[DEL] [char](1) NULL,
	[FLAG] [int] NULL,
	[ORDERCODE] [varchar](20) NULL,
	[SUBORDERCODE] [varchar](20) NULL,
	[PRODUCTNAME] [varchar](100) NULL,
	[QTY] [int] NULL,
	[PRODUCTCODE] [varchar](100) NULL,
 CONSTRAINT [PK_T_ORDER] PRIMARY KEY CLUSTERED 
(
	[PK] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[T_PLACE]    Script Date: 2024-03-13 14:11:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_PLACE](
	[PK] [varchar](20) NOT NULL,
	[CREATEDATE] [varchar](20) NULL,
	[CREATOR] [varchar](20) NULL,
	[MODIFYDATE] [varchar](20) NULL,
	[MODIFIER] [varchar](20) NULL,
	[DELETEUSER] [varchar](20) NULL,
	[DELETEDATE] [varchar](20) NULL,
	[DEL] [char](1) NULL,
	[FLAG] [int] NULL,
	[PLACECODE] [varchar](50) NULL,
	[PLACENAME] [varchar](50) NULL,
	[PLACEGROUP] [varchar](50) NULL,
 CONSTRAINT [PK_T_PLACE] PRIMARY KEY CLUSTERED 
(
	[PK] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[T_STOCKRECORD]    Script Date: 2024-03-13 14:11:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_STOCKRECORD](
	[PK] [varchar](20) NOT NULL,
	[CREATEDATE] [varchar](20) NULL,
	[CREATOR] [varchar](20) NULL,
	[MODIFYDATE] [varchar](20) NULL,
	[MODIFIER] [varchar](20) NULL,
	[DELETEUSER] [varchar](20) NULL,
	[DELETEDATE] [varchar](20) NULL,
	[DEL] [char](1) NULL,
	[FLAG] [int] NULL,
	[ORDERCODE] [varchar](50) NULL,
	[QRCODE] [varchar](50) NULL,
	[QTY] [int] NULL,
	[PRODUCTCODE] [varchar](50) NULL,
	[PRODUCTNAME] [varchar](50) NULL,
	[PLACEID] [varchar](20) NULL,
	[TYPE] [int] NULL,
	[PLACECODE] [varchar](20) NULL,
	[ONHAND] [int] NULL,
	[SRCRECORD] [varchar](20) NULL,
 CONSTRAINT [PK_T_STOCKIN] PRIMARY KEY CLUSTERED 
(
	[PK] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[T_USER]    Script Date: 2024-03-13 14:11:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_USER](
	[PK] [varchar](20) NOT NULL,
	[CREATEDATE] [varchar](20) NULL,
	[CREATOR] [varchar](20) NULL,
	[MODIFYDATE] [varchar](20) NULL,
	[MODIFIER] [varchar](20) NULL,
	[DELETEUSER] [varchar](20) NULL,
	[DELETEDATE] [varchar](20) NULL,
	[DEL] [char](1) NULL,
	[FLAG] [int] NULL,
	[USERCODE] [varchar](50) NULL,
	[USERNAME] [varchar](50) NULL,
	[AVALIABLE] [char](1) NULL,
	[PASSWORD] [varchar](32) NULL,
 CONSTRAINT [PK_T_USER] PRIMARY KEY CLUSTERED 
(
	[PK] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[T_USERRIGHT]    Script Date: 2024-03-13 14:11:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_USERRIGHT](
	[PK] [varchar](20) NOT NULL,
	[CREATEDATE] [varchar](20) NULL,
	[CREATOR] [varchar](20) NULL,
	[MODIFYDATE] [varchar](20) NULL,
	[MODIFIER] [varchar](20) NULL,
	[DELETEUSER] [varchar](20) NULL,
	[DELETEDATE] [varchar](20) NULL,
	[DEL] [char](1) NULL,
	[FLAG] [int] NULL,
	[MOD] [varchar](20) NULL,
	[USERID] [varchar](20) NULL,
	[READ] [char](1) NULL,
	[WRITE] [char](1) NULL,
	[REMOVE] [char](1) NULL,
	[APPROVE] [char](1) NULL,
 CONSTRAINT [PK_T_USERRIGHT] PRIMARY KEY CLUSTERED 
(
	[PK] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO

INSERT [dbo].[T_USER] ([PK], [CREATEDATE], [CREATOR], [MODIFYDATE], [MODIFIER], [DELETEUSER], [DELETEDATE], [DEL], [FLAG], [USERCODE], [USERNAME], [AVALIABLE], [PASSWORD]) VALUES (N'00000000000000000000', N'2000-01-01 00:00:00', N'00000000000000000000', NULL, NULL, NULL, NULL, N'N', 1, N'admin', N'管理员', N'Y', N'E10ADC3949BA59ABBE56E057F20F883E')
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [NonClusteredIndex-20240313-140027]    Script Date: 2024-03-13 14:11:51 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20240313-140027] ON [dbo].[T_STOCKRECORD]
(
	[SRCRECORD] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [NonClusteredIndex-20240313-140049]    Script Date: 2024-03-13 14:11:51 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20240313-140049] ON [dbo].[T_STOCKRECORD]
(
	[QRCODE] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [NonClusteredIndex-20240313-140121]    Script Date: 2024-03-13 14:11:51 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20240313-140121] ON [dbo].[T_STOCKRECORD]
(
	[PLACECODE] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [NonClusteredIndex-20240313-140145]    Script Date: 2024-03-13 14:11:51 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20240313-140145] ON [dbo].[T_STOCKRECORD]
(
	[PRODUCTNAME] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
USE [master]
GO
ALTER DATABASE [wms] SET  READ_WRITE 
GO
